package com.example.wlt.personnel_manegement_system.Manager.Task;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import com.example.wlt.personnel_manegement_system.Manager.My.Mycenter;
import com.example.wlt.personnel_manegement_system.Manager.Org.Organization;
import com.example.wlt.personnel_manegement_system.Manager.Org.search;
import com.example.wlt.personnel_manegement_system.Manager.Person.Person;
import com.example.wlt.personnel_manegement_system.R;

/**
 * Created by WLT on 2016/4/18.
 */
public class Task extends Activity {
    private ImageButton ibtn_org;
    private ImageButton ibtn_person;
    private ImageButton ibtn_mycenter;
    private TextView tv_creat;//创建任务按钮
    private TextView tv_history;//任务历史按钮
    private Button btn_TaskBack;//返回按钮
    private ImageButton ibtn_search;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.task);
        tv_creat=(TextView)findViewById(R.id.tv_task_creat);
        tv_history=(TextView)findViewById(R.id.tv_task_history);
        ibtn_org=(ImageButton)findViewById(R.id.ibtn_org);
        ibtn_person=(ImageButton)findViewById(R.id.ibtn_person);
        ibtn_mycenter=(ImageButton)findViewById(R.id.ibtn_mycenter);
        btn_TaskBack = (Button) findViewById(R.id.btn_org_headleft);
        ibtn_search=(ImageButton)findViewById(R.id.ibtn_org_search);
        ibtn_search.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent=new Intent(Task.this, search.class);
                startActivity(Intent);
            }
        });
        //返回app首页即部门页面
        btn_TaskBack.setOnClickListener(new View.OnClickListener() {//点击按钮返回主页面，即部门页面
            @Override
            public void onClick(View view) {
                Intent Intent = new Intent(Task.this,Organization.class);
                startActivity(Intent);
                finish();
            }

        });
        //进入任务创建页面
        tv_creat.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent = new Intent(Task.this, Creat.class);
                startActivity(Intent);
            }
        });
        //进入任务历史页面
        tv_history.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent=new Intent(Task.this,Taskhistory.class);
                startActivity(Intent);
            }
        });
        //进入个人页面
        ibtn_mycenter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent=new Intent(Task.this,Mycenter.class);
                startActivity(Intent);
                finish();
            }
        });
        //进入部门页面
        ibtn_org.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent = new Intent(Task.this,Organization.class);
                startActivity(Intent);
                finish();
            }
        });
        //进入成员页面
        ibtn_person.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent Intent = new Intent(Task.this,Person.class);
                startActivity(Intent);
                finish();
            }
        });
    }
}